package com.example.mobile2021606129ly0615;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private RecyclerView rvMainUser;
    private List<User>list=new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        list.add(new User(1,"张三",20,90));
        list.add(new User(2,"李四",25,80));
        rvMainUser.setAdapter(new UserAdapetr(list));
    }
    private void initView(){
        rvMainUser=(RecyclerView)findViewById(R.id.rvMainUser);
        rvMainUser.setLayoutManager(new LinearLayoutManager(this));
    }
}